package com.tarena.practice.manage.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.tarena.practice.manage.service.UserService;
import com.tarena.practice.manage.vo.Page;
import com.tarena.practice.manage.vo.SysResult;
import com.tarena.practice.manage.vo.UserResult;

@Controller
public class UserController {
	@Autowired
	private UserService userService;
	@RequestMapping("user/query")
	@ResponseBody
	public SysResult queryUsersByPage(Page page){
		return userService.queryUsersByPage(page);
	}
	
	@RequestMapping("user/delete/{ids}")
	@ResponseBody
	public SysResult deleteUsersById(@PathVariable int[] ids){
		return userService.deleteUsersById(ids);
	}
	
	@RequestMapping("user/update")
	@ResponseBody
	public SysResult updateUses(UserResult userResult){
		return userService.updateUser(userResult);
	}
}
